<?php

class IndexController extends BaseController {
        
    public function indexAction($requestData) {    	
    	/*
    	if(isset($requestData['arg0'])) {
    		$member = Member::get($requestData['arg0'], "login");
    		if($member->id > 0) {
    			BaseController::forward('Member', 'profile');
    			MemberController::profileAction($requestData, $member);
    			return;
    		}
    	}
		$this->data['pageTitle'] = 'PEAK.COM: Adventure Sports, Endurance Sports, Extreme Sports, Outdoor Sports, People Inspiring People';
		$this->data['marquee'] = Marquee::getMarquee();
		
		$this->data['featured'] = Featured::getFeatured();
		$this->data['featuredVideos'] = Video::getFeaturedVideos();
		*/
    	
    	// get featured sport    	
    	$sportStr = isset($requestData['arg1']) ? $requestData['arg1'] : "";
    	$homepage = true;
    	$featured = pk_sport::getFeaturedSport($sportStr, $homepage);
    	$sport = $featured->id;
    	
    	$this->data['featuredTitle'] = $featured->name;
    	
    	$this->data['featured'] = pk_featured::getFeatured($sport);
    	
    	$this->data['featuredVideos'] = pk_video::getVideos($sport);
    	
    	$this->data['featuredBlog'] = pk_blog::getLatestBlog($sport);
		
    	// news
    	$this->data['newsFeeds'] = pk_feed::getNewsFeeds($sport);
    	
    	if(empty($this->data['newsFeeds'])) {
    		$this->data['nodata'] = true;
    	}
    	
		// needed sports
		$this->data['sports'] = pk_sport::getAll();
		
		if(!$homepage) {
			$this->data['pageTitle'] = $featured->name. " News - PEAK.COM";
		}
    }
    
    public function about_usAction($requestData) {
    	$this->data['pageTitle'] = "About Us - PEAK.COM";
    }
    
    public function advertiseAction($requestData) {
    	$this->data['pageTitle'] = "Advertise on our site - PEAK.COM";
    }

}

?>